package com.yugao.fintech.antelope.mps.api.constatnts;

import com.yugao.fintech.framework.assistant.utils.exception.BizException;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;


@Getter
@AllArgsConstructor
public enum PushTaskCodeEnum {
    REGISTER_VERIFY("register_verify"),
    VERIFY_EMAIL("verify_email"),
    VERIFY_SMS("verify_sms"),

    /**
     * 站内消息推送(业务版)
     */
    BIZ_SITE_PUSH("biz_site_push"),
    ;
    private final String code;

    public static void checkExist(String taskCode) {
        if (Arrays.stream(values()).noneMatch(e -> e.getCode().equals(taskCode))) {
            throw new BizException("任务编码 {} 不存在, 请联系管理员", taskCode);
        }
    }

}
